package com.springBoot.springBootSysCore;

import org.mybatis.spring.annotation.MapperScan;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.boot.autoconfigure.domain.EntityScan;
import org.springframework.boot.builder.SpringApplicationBuilder;
import org.springframework.boot.web.servlet.ServletComponentScan;
import org.springframework.boot.web.support.SpringBootServletInitializer;
import org.springframework.cache.annotation.EnableCaching;
import org.springframework.context.annotation.ComponentScan;
import org.springframework.context.annotation.PropertySource;
import org.springframework.data.jpa.repository.config.EnableJpaRepositories;
import org.springframework.transaction.annotation.EnableTransactionManagement;

@EnableCaching
@SpringBootApplication
@ServletComponentScan("com.springBoot.springBootSysCore.*")
@ComponentScan(value = "com.springBoot.springBootSysCore.*")
@EnableTransactionManagement
@EntityScan(basePackages = "com.springBoot.springBootSysCore.modules.entity.*")
@MapperScan("com.springBoot.springBootSysCore.modules.mapper")
@EnableJpaRepositories(basePackages = "com.springBoot.springBootSysCore.modules.repository.*")
@PropertySource("classpath:init.properties")//配置在这里和config中都可以全局读取
public class SpringBootSysCoreApplication  extends SpringBootServletInitializer {
	
	@Override  
    protected SpringApplicationBuilder configure(SpringApplicationBuilder application) {  
        return application.sources(SpringBootSysCoreApplication.class);  
    }  
	
	public static void main(String[] args) {
		SpringApplication.run(SpringBootSysCoreApplication.class, args);
	}
}
